{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 线性回归"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这个是另一位大牛写的\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 单变量线性回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Population</th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6.1101</td>\n",
       "      <td>17.5920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.5277</td>\n",
       "      <td>9.1302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8.5186</td>\n",
       "      <td>13.6620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7.0032</td>\n",
       "      <td>11.8540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.8598</td>\n",
       "      <td>6.8233</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Population   Profit\n",
       "0      6.1101  17.5920\n",
       "1      5.5277   9.1302\n",
       "2      8.5186  13.6620\n",
       "3      7.0032  11.8540\n",
       "4      5.8598   6.8233"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path =  'ex1data1.txt'\n",
    "data = pd.read_csv(path, header=None, names=['Population', 'Profit'])\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Population</th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>97.000000</td>\n",
       "      <td>97.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>8.159800</td>\n",
       "      <td>5.839135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.869884</td>\n",
       "      <td>5.510262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>5.026900</td>\n",
       "      <td>-2.680700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>5.707700</td>\n",
       "      <td>1.986900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>6.589400</td>\n",
       "      <td>4.562300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>8.578100</td>\n",
       "      <td>7.046700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>22.203000</td>\n",
       "      <td>24.147000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Population     Profit\n",
       "count   97.000000  97.000000\n",
       "mean     8.159800   5.839135\n",
       "std      3.869884   5.510262\n",
       "min      5.026900  -2.680700\n",
       "25%      5.707700   1.986900\n",
       "50%      6.589400   4.562300\n",
       "75%      8.578100   7.046700\n",
       "max     22.203000  24.147000"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "看下数据长什么样子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAHjCAYAAADlk0M8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+Q3OldH/j309LsaNhZ7GFkfEZjs3GJS85wskgU2yCg\njLnjwGcEPqUojCHmQuJQBxS+JCdRUAQDlQsrfl0OHDhjuzB3PkhgMLv2OZcD1vywq2zQGu14/YPY\npNbsKIu9DFp7x5FmR+rn/pie9Ug7P/qrmZ5vd8/rVTU1Pd/+9vSjp1s973768zxPqbUGAADoX6ft\nBgAAwKgRogEAoCEhGgAAGhKiAQCgISEaAAAaEqIBAKAhIRoAABoSogEAoCEhGgAAGjrcdgP6cfTo\n0Xr33Xe33QwAAMbcAw888Fe11mftdN5IhOi77747Fy9ebLsZAACMuVLKJ/o5TzkHAAA0JEQDAEBD\nAwvRpZTnllLeXUr5cCnlQ6WUH+gdf30p5XIp5VLv6+WDagMAAAzCIGuiryf5p7XWD5RS7kryQCnl\nd3rX/Vyt9acHeN8AADAwAwvRtd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LaU8u5Ryd9aC+//cGxH/\n6lLK60sp/6x3m5OllPeVUhZKKW8vpcz0jv9+KeWeUsofl1L+QynlqwffPQDDSYgGaEkp5XCSb0zy\nwVLK30nyPyZ5cZKXJPlHpZQv7536N5P861rrf5XkM0n+pwZ3854kL6m1fnmSX09yrtb6cJJfSvJz\nvRHxP7rlNr+a5Hyt9UTWdhD80Q3XHa61vijJ6245DnCgCNEA+2+qlHIpycUkf5HkzVnb4vbttdbP\n1lqXk/xWkvWR3kdqre/tXf6/euf2ay7Jvy+lfDDJ/5LkS7c7uZTyjCTPrLX+Qe/QW5N8zYZTfqv3\n/YEkdzdoB8BYOdx2AwAOoKu11pMbD5RStju/bvHz9XxuMOTIFrf9+SQ/W2u9r5Ty0iSvb9TSp1vp\nfb8Rf0OAA8xINMBw+KMk31JK+bxSyp1JXtk7liTPK6V8Re/yt2etRCNJHk7yd3qXz27xe5+R5HLv\n8ms2HH8iyV23nlxr/XSSKxvqnb8zyR/ceh7AQSdEAwyBWusHkvxKkj9O8v4kb6q1/mnv6j9L8r2l\nlI8kmUnyi73jP5bkX5VSLmZtZHgzr0/yG6WUB5L81Ybj70jyyvWJhbfc5jVJfqqUspDkZJIf382/\nDWAclVpv/ZQQgGHRW0njnb3l8AAYEkaiAQCgISPRAADQkJFoAABoSIgGAICGhGgAAGhIiAYAgIaE\naAAAaOj/Bx2CAHZLVRXDAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9bb1f98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data.plot(kind='scatter', x='Population', y='Profit', figsize=(12,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在让我们使用梯度下降来实现线性回归，以最小化成本函数。 以下代码示例中实现的方程在“练习”文件夹中的“ex1.pdf”中有详细说明。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "首先，我们将创建一个以参数θ为特征函数的代价函数\n",
    "$$J\\left( \\theta  \\right)=\\frac{1}{2m}\\sum\\limits_{i=1}^{m}{{{\\left( {{h}_{\\theta }}\\left( {{x}^{(i)}} \\right)-{{y}^{(i)}} \\right)}^{2}}}$$\n",
    "其中：\\\\[{{h}_{\\theta }}\\left( x \\right)={{\\theta }^{T}}X={{\\theta }_{0}}{{x}_{0}}+{{\\theta }_{1}}{{x}_{1}}+{{\\theta }_{2}}{{x}_{2}}+...+{{\\theta }_{n}}{{x}_{n}}\\\\] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def computeCost(X, y, theta):\n",
    "    inner = np.power(((X * theta.T) - y), 2)\n",
    "    return np.sum(inner) / (2 * len(X))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "让我们在训练集中添加一列，以便我们可以使用向量化的解决方案来计算代价和梯度。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data.insert(0, 'Ones', 1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在我们来做一些变量初始化。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# set X (training data) and y (target variable)\n",
    "cols = data.shape[1]\n",
    "X = data.iloc[:,0:cols-1]#X是所有行，去掉最后一列\n",
    "y = data.iloc[:,cols-1:cols]#X是所有行，最后一列"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "观察下 X (训练集) and y (目标变量)是否正确."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Ones</th>\n",
       "      <th>Population</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>6.1101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>5.5277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>8.5186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>7.0032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>5.8598</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Ones  Population\n",
       "0     1      6.1101\n",
       "1     1      5.5277\n",
       "2     1      8.5186\n",
       "3     1      7.0032\n",
       "4     1      5.8598"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.head()#head()是观察前5行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17.5920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>9.1302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13.6620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>11.8540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6.8233</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Profit\n",
       "0  17.5920\n",
       "1   9.1302\n",
       "2  13.6620\n",
       "3  11.8540\n",
       "4   6.8233"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "代价函数是应该是numpy矩阵，所以我们需要转换X和Y，然后才能使用它们。 我们还需要初始化theta。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X = np.matrix(X.values)\n",
    "y = np.matrix(y.values)\n",
    "theta = np.matrix(np.array([0,0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "theta 是一个(1,2)矩阵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[0, 0]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "theta"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "看下维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((97, 2), (1, 2), (97, 1))"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape, theta.shape, y.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "计算代价函数 (theta初始值为0)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "32.072733877455676"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "computeCost(X, y, theta)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# batch gradient decent（批量梯度下降）\n",
    "$${{\\theta }_{j}}:={{\\theta }_{j}}-\\alpha \\frac{\\partial }{\\partial {{\\theta }_{j}}}J\\left( \\theta  \\right)$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def gradientDescent(X, y, theta, alpha, iters):\n",
    "    temp = np.matrix(np.zeros(theta.shape))\n",
    "    parameters = int(theta.ravel().shape[1])\n",
    "    cost = np.zeros(iters)\n",
    "    \n",
    "    for i in range(iters):\n",
    "        error = (X * theta.T) - y\n",
    "        \n",
    "        for j in range(parameters):\n",
    "            term = np.multiply(error, X[:,j])\n",
    "            temp[0,j] = theta[0,j] - ((alpha / len(X)) * np.sum(term))\n",
    "            \n",
    "        theta = temp\n",
    "        cost[i] = computeCost(X, y, theta)\n",
    "        \n",
    "    return theta, cost"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "初始化一些附加变量 - 学习速率α和要执行的迭代次数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "alpha = 0.01\n",
    "iters = 1000"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在让我们运行梯度下降算法来将我们的参数θ适合于训练集。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-3.24140214,  1.1272942 ]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g, cost = gradientDescent(X, y, theta, alpha, iters)\n",
    "g"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最后，我们可以使用我们拟合的参数计算训练模型的代价函数（误差）。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.5159555030789118"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "computeCost(X, y, g)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在我们来绘制线性模型以及数据，直观地看出它的拟合。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAHwCAYAAABg0TMJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4lFX6xvHvIUYIRSKIaEIVMYCgBKKC2FtcXTGi4qJi\nFysKSiju7s+y7goEKdIULIAiiyJmdUURARXsYNBoIIAKSII0iYBECcn5/XEmGNh0MvNOuT/XxeXk\nzZRnJkjuOfO8zzHWWkREREREpPJqeV2AiIiIiEioUYgWEREREakihWgRERERkSpSiBYRERERqSKF\naBERERGRKlKIFhERERGpIoVoEQlKxphWxhhrjDnM9/XbxpgbA/C4jxhjXvL34/geK8EYs8IYs8sY\nc58x5mljzN8D8djBxhizzhhzQTVve6YxJruma6rE40bsz0tEFKJF5BD4gk++MWa3MWazMWaaMaa+\nPx7LWvsna+30StZUrTBWifs+xxhT5Hu+u4wx2caYmw/h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nhecvvnCBecQIuOMOaNjQ6+rEDxSiRURERKrr99/dltwjR0J2tmvVeOYZuOEGqFPH6+rEjxSiRURE\nRKpq1y6YMsWNpsvNhS5d4JVXoFcviIryujoJAIVoERERkcrauhWeegomTHDzns87z03duOACjamL\nMArRIiIiIhVZtw5GjYLnn4fffnMrzkOGwCmneF2ZeEQhWkRERKQsmZnuBMF//9vtJnjDDZCaCgkJ\nXlcmHlOIFhERETnY0qVu0sZbb0G9ejBgAAwcCPHxXlcmQUIhWkRERATcmLp581x4/ugjaNwYHnsM\n7rkHGjXyujoJMgrRIiIiEtkKCly7xogR8O230LIljB/vdhisW9fr6iRIKUSLiIhIZNqzB557zp0w\nuGEDdOwIL74I11zjtukWKYdCtIiIiESWn392I+rGj4dt26BHD5g4ES69VGPqpNIUokVERCQybNzo\nNkeZMgV+/RX+/Gc3pu6MM7yuTEKQQrSIiIiEt1Wr3LbcL73kTh689loYPNi1b4hUk0K0iIiIhKfP\nP3eTNtLToU4duPNOeOABaNXK68okDChEi4iISPiwFhYscOF58WI48kj429+gf39o0sTr6iSMKESL\niIhI6Nu3D157zY2py8hwm6KMHg233w7163tdnYQhhWgREREJXb/9BtOnQ1oafPed2477+efhuuvg\n8MO9rk7CmEK0iIiIhJ5ffoHJk2HsWNi8GU45xQXpyy+HWrW8ri6kpGfkkDY/m9y8fOJiY0hNTiAl\nUdubV0QhWkRERELHTz+54Dx5MuzcCRddBEOHwjnnaMZzNaRn5DBsbib5BYUA5OTlM2xuJoCCdAX0\nVk1ERESC39q1brpGq1ZuxTk5GZYvh/nz4dxzFaCrKW1+9v4AXSy/oJC0+dkeVRQ6tBItIiIiwevL\nL93JgnPmwGGHwU03waBB0Lat15WFhdy8/Codlz8oRIuIiEhwsRbef9+NqXv3XWjQAFJT4f774dhj\nva4urMTFxpBTSmCOi43xoJrQonaOEJWekUOP4YtoPfQtegxfRHpGjtcliYiIHJqiInj9dejWDc47\nD1asgH/9CzZscIFaAbrGpSYnEBMddcCxmOgoUp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epKhmhJaq+fAK8A\niIhP5Gen10XEeflth0fEgxFxQ0T8MiJuGZu5joiNEfHi/O3ZEXHvxCePiNMj4r6IWBURP4qIl0TE\n4eSC+8fzM+InRcSlEXF+/jEzI2JZRKyJiNsi4sD89nsj4nMR8bOIeCgiTmr+8EhSZzJES1KbRMQ0\n4DRgbUQcB7wbOAGYA/yviJiV33UG8NWU0iuBbcCHMrzMT4E5KaVZwI3ABSmljcDVwBfzM+I/mfCY\n64ELU0rHkltF8FMF901LKR0PnDdhuyRNKoZoSWq9/ohYDSwHHgO+QW6529tSSr9PKT0HLAbGZnp/\nnVJamr/9nfy+1XoZsCQi1gILgKPL7RwRBwADKaX/yG+6Dnh9wS6L899XAIdnOA5J6inT2n0AkjQJ\njaSUZhZuiIhy+6cSP+/ghcmQvUs89svAFSml2yPiZODSTEe6pz/kv+/Ef0MkTWLOREtSZ/gJMD8i\n9omIfYG35bcBHBYRr8nf/ltyJRoAG4Hj8rffXuJ5DwCG87fPLtj+LLDfxJ1TSluBzQX1zu8C/mPi\nfpI02RmiJakDpJRWAt8GfgbcB3w9pbQqf/d64MMR8UvgQOBr+e2fBq6MiOXkZoaLuRS4OSJWAL8t\n2P594G1jFxZOeMzZwKKIWAPMBC6r588mSb0oUpr4W0JJUqfId9L4Qb4dniSpQzgTLUmSJGXkTLQk\nSZKUkTPRkiRJUkaGaEmSJCkjQ7QkSZKUkSFakiRJysgQLUmSJGVkiJYkSZIy+v9JU5gv3mOwXwAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9c64240>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(data.Population.min(), data.Population.max(), 100)\n",
    "f = g[0, 0] + (g[0, 1] * x)\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(12,8))\n",
    "ax.plot(x, f, 'r', label='Prediction')\n",
    "ax.scatter(data.Population, data.Profit, label='Traning Data')\n",
    "ax.legend(loc=2)\n",
    "ax.set_xlabel('Population')\n",
    "ax.set_ylabel('Profit')\n",
    "ax.set_title('Predicted Profit vs. Population Size')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由于梯度方程式函数也在每个训练迭代中输出一个代价的向量，所以我们也可以绘制。 请注意，代价总是降低 - 这是凸优化问题的一个例子。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtQAAAHwCAYAAACG+PhNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xe4XFW9//H39yQkkAQIgYQaCELonYD0FqQGEAtdlCqK\nvV1BL3r1Kv4uXAVBKRcsCNJCk470IhJSKEJAOiS0EJBAICFl/f5Yc8zJyZxkn8yZs+ec8349z35m\nZu89M9/JpnxYfPdakVJCkiRJ0uJpKrsASZIkqSszUEuSJEk1MFBLkiRJNTBQS5IkSTUwUEuSJEk1\nMFBLkiRJNTBQS1IPExG7RMQTHX1uVxARkyJil7LrkNS9GKgldRsR8WJEfBgR77fYzi67rlpExI4t\nfsv0iEitft/q7f3MlNLdKaUNO/rc9oqI+yNiRqvfc009vkuS6ql32QVIUgfbL6V0+6JOiojeKaXZ\ni9rX3s/oaCml+4ABle8bBrwADGzreyOiqfK+ufWsqwOdkFL6Q9lFSFItHKGW1CNExBci4oGI+FVE\nTAV+3Ma+poj4YUS8FBFvRsRFEbFs5TOGVUaIj4mIl4E7q3zPxIgY1eJ174iYEhFbRMSSEXFxREyN\niH9FxMMRsWIH/Lb7I+KnEfEgMB1YPSKOrdTyXkQ8FxHHtjh/94h4scXrSRHxrYh4PCLejYhLI6Jv\ne8+tHD8pIl6PiMkRcVzlz2vYYvym3Sv/x+GUyp/XCxFxSIvjAyt/llMq550UEdHi+Bcj4qnK7/9H\nRGza4uO3aKt+SVocBmpJPcnHgeeBFYGftbHvC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QO1JDWe94ClW7y+FfhSRCwBEBHr\nRET/Ku9bFngnpfRBRKwHbNPi2Kzm97dyH3BwpU97MLATMKatwiJiALBsSukm4JvkVhFJ6tHsoZak\nxvMYMKfSuvEH4Exyu8X4yo2BU4BPVnnfLcAJlT7np8ltH83OBx6LiPEppcNb7L8G2BZ4FEjA91JK\nr1cCeTVLA9dFxJLkkfNvLd5PlKTuI1JKZdcgSZIkdVm2fEiSJEk1MFBLkiRJNTBQS5IkSTUwUEuS\nJEk1MFBLkiRJNTBQS5IkSTUwUEuSJEk1MFBLkiRJNfj/NPGqg4HPEBEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9c686d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(12,8))\n",
    "ax.plot(np.arange(iters), cost, 'r')\n",
    "ax.set_xlabel('Iterations')\n",
    "ax.set_ylabel('Cost')\n",
    "ax.set_title('Error vs. Training Epoch')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多变量线性回归"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "练习1还包括一个房屋价格数据集，其中有2个变量（房子的大小，卧室的数量）和目标（房子的价格）。 我们使用我们已经应用的技术来分析数据集。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Size</th>\n",
       "      <th>Bedrooms</th>\n",
       "      <th>Price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2104</td>\n",
       "      <td>3</td>\n",
       "      <td>399900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1600</td>\n",
       "      <td>3</td>\n",
       "      <td>329900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2400</td>\n",
       "      <td>3</td>\n",
       "      <td>369000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1416</td>\n",
       "      <td>2</td>\n",
       "      <td>232000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3000</td>\n",
       "      <td>4</td>\n",
       "      <td>539900</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Size  Bedrooms   Price\n",
       "0  2104         3  399900\n",
       "1  1600         3  329900\n",
       "2  2400         3  369000\n",
       "3  1416         2  232000\n",
       "4  3000         4  539900"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path =  'ex1data2.txt'\n",
    "data2 = pd.read_csv(path, header=None, names=['Size', 'Bedrooms', 'Price'])\n",
    "data2.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于此任务，我们添加了另一个预处理步骤 - 特征归一化。 这个对于pandas来说很简单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Size</th>\n",
       "      <th>Bedrooms</th>\n",
       "      <th>Price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.130010</td>\n",
       "      <td>-0.223675</td>\n",
       "      <td>0.475747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.504190</td>\n",
       "      <td>-0.223675</td>\n",
       "      <td>-0.084074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.502476</td>\n",
       "      <td>-0.223675</td>\n",
       "      <td>0.228626</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.735723</td>\n",
       "      <td>-1.537767</td>\n",
       "      <td>-0.867025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.257476</td>\n",
       "      <td>1.090417</td>\n",
       "      <td>1.595389</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Size  Bedrooms     Price\n",
       "0  0.130010 -0.223675  0.475747\n",
       "1 -0.504190 -0.223675 -0.084074\n",
       "2  0.502476 -0.223675  0.228626\n",
       "3 -0.735723 -1.537767 -0.867025\n",
       "4  1.257476  1.090417  1.595389"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2 = (data2 - data2.mean()) / data2.std()\n",
    "data2.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在我们重复第1部分的预处理步骤，并对新数据集运行线性回归程序。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.13070336960771892"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# add ones column\n",
    "data2.insert(0, 'Ones', 1)\n",
    "\n",
    "# set X (training data) and y (target variable)\n",
    "cols = data2.shape[1]\n",
    "X2 = data2.iloc[:,0:cols-1]\n",
    "y2 = data2.iloc[:,cols-1:cols]\n",
    "\n",
    "# convert to matrices and initialize theta\n",
    "X2 = np.matrix(X2.values)\n",
    "y2 = np.matrix(y2.values)\n",
    "theta2 = np.matrix(np.array([0,0,0]))\n",
    "\n",
    "# perform linear regression on the data set\n",
    "g2, cost2 = gradientDescent(X2, y2, theta2, alpha, iters)\n",
    "\n",
    "# get the cost (error) of the model\n",
    "computeCost(X2, y2, g2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们也可以快速查看这一个的训练进程。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtoAAAHwCAYAAACYMcj+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUXWWd7//3t6pIAmHIQCWYiQQIQpgxIg6gtIJwRXDA\nFhzQiy3i2D/UbqH1tna7utXbvWxvdwNeWnFABbkIikiDSjeiIpBEkVEkhkAShhREZkJI8v39sU+Z\nQ1FJaji79hner7X22mdP53xP7RA+9eTZzxOZiSRJkqTG6qq6AEmSJKkdGbQlSZKkEhi0JUmSpBIY\ntCVJkqQSGLQlSZKkEhi0JUmSpBIYtCVJAETEqyLitkaf2woiYmVEvKrqOiS1F4O2pLYXEcsj4umI\neKJu+feq6xqNiDis7rs8GRE54PvNGe57ZuY1mblPo88droj4RUSsHfB9Li3jsySpTD1VFyBJY+T1\nmfnTrZ0UET2ZuX5r+4b7Ho2WmT8Htq993lzgbmDS5j43Irpq120ss64GOi0zv151EZI0GrZoS+po\nEfHuiPhlRPxLR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T8nMNRGxLbAoIr6XmWdE\nxIcy88BBPutNwIHAAcDOtWuurR07CNgHuA/4JfDyiLgDeCOwV2ZmRExq+LeXpBZii7YktbajgJMj\n4ibgBmAqML927Ma6kA3wkYj4LXA9MLvuvM15BXBBZm7IzAeBnwEvrnvvlZm5EbiJokvLo8Ba4KsR\n8SbgqVF/O0lqYQZtSWptAXw4Mw+sLfMys79F+8k/nRTxKuA1wEsz8wDgN8CEUXzuM3WvNwA9mbke\nOAS4GDgWuHIU7y9JLc+gLUmt5XFgh7rtq4D3R8Q2ABGxZ0RMHOS6nYA/ZuZTEbEXcGjdsWf7rx/g\n58Bba/3Ae4HDgRs3V1hEbA/slJlXAKdTdDmRpI5lH21Jai03AxtqXUC+Dvwfim4bv649kNgHvGGQ\n664ETqv1o76TovtIv3OBmyPi15n59rr9lwIvBX4LJPDXmflALagPZgfgBxExgaKl/aMj+4qS1B4i\nM6uuQZIkSWo7dh2RJEmSSmDQliRJkkpg0JYkSZJKYNCWJEmSSmDQliRJkkpg0JYkSZJKYNCWJEmS\nSmDQliRJkkrw/wOcUIPzigueowAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9c91400>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(12,8))\n",
    "ax.plot(np.arange(iters), cost2, 'r')\n",
    "ax.set_xlabel('Iterations')\n",
    "ax.set_ylabel('Cost')\n",
    "ax.set_title('Error vs. Training Epoch')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们也可以使用scikit-learn的线性回归函数，而不是从头开始实现这些算法。 我们将scikit-learn的线性回归算法应用于第1部分的数据，并看看它的表现。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn import linear_model\n",
    "model = linear_model.LinearRegression()\n",
    "model.fit(X, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "scikit-learn model的预测表现"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAHwCAYAAABg0TMJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xt8XHWd//H3pyHQkZaGS7kkYFsFUqCFpkQoFkRBCMot\nVC4iKLooq6so+CPQ+sO1uOyvZYtl0V1RFAUUWAVLRC4bKkW5qGhKCqGl4aLlMqlQCoEWBpum398f\nZ6bNJHNN5sw5Z+b1fDx4kH5n5sxnTtrkPd/5nO/XnHMCAAAAULgxQRcAAAAARA0hGgAAACgSIRoA\nAAAoEiEaAAAAKBIhGgAAACgSIRoAAAAoEiEaQCiZ2WQzc2a2XfLP95nZeWV43vlm9nO/nyf5XI1m\ntsLMNpjZV83sB2b2zXI8d9iY2Roz++gIH3uUmfWUuqYCnrdqv18ACNEARiEZfBJmttHMXjGzG81s\nnB/P5Zz7mHPupgJrGlEYK+DYHzazLcnXu8HMeszsc6M45KWSHnTOjXfOfdc590Xn3L8Neq6XS1N5\n4ZJvIvqTr7HPzP5gZkeUu45ckm+u9k392Tn3sHOu0afnOt/MVie/36+Y2b1mNj75vFu/XwCqDyEa\nwGid7JwbJ2mmpGZJlw+9g3kq5edNb/L17iTpMkk/MrMDh94pNYOexyRJK0tcXyn8IvkaJ0p6RNIS\nM7OAayo7Mzta0v+TdLZzbrykAyT9ItiqAIRFpfxSAxAw51xc0n2SpkmSmf3OzP7dzB6V9I6k95nZ\nBDO7wczWmlnczK40s5rk/WvM7Goze83M/irpxMHHTx7v84P+/AUzezo5Q7jKzGaa2c8kv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qKW2//fb6wQ9+kHa7c05btmwp+rinnHKK5s6dm/X2oSG6vr5ed9xxR9HP\nAwAAgJHxNUSbWa28AH2Lc26JJDnnXnHODTjntkj6kaTDMj3WOXe9c67ZOdc8cWLenRcDd9RRR+m5\n557TmjVr1NjYqM985jOaNm2aXnrpJd1///064ogjNHPmTJ1xxhnauHGjJOl///d/NXXqVM2cOVNL\nlizZeqwbb7xRX/nKVyRJr7zyik477TQdcsghOuSQQ/SHP/xBc+fO1fPPP68ZM2aora1Na9as0bRp\n0yR5veKf+9znNH36dDU1NenBBx/cesw5c+bohBNO0H777adLL720zGcIAACgcvi5OodJukHS0865\nxYPG90r2S0vSaZKeGvWTXXSRtGLFqA+TZsYM6T//s6C7bt68Wffdd59OOOEESdKzzz6rm266SbNm\nzdJrr72mK6+8Ur/97W+144476qqrrtLixYt16aWX6gtf+IKWLVumfffdV2eddVbGY3/1q1/V0Ucf\nrTvvvFMDAwPauHGjFi5cqKeeekorkq95zZo1W+//3//93zIzdXd3a/Xq1Tr++OP1zDPPSJJWrFih\nrq4u7bDDDmpsbNSFF16offbZZxQnCQAAoDr5uTrHbEmfltRtZqmE+w1JZ5vZDHnL3q2R9M8+1uCr\nRCKhGTNmSPJmos8//3z19vZq0qRJmjVrliTpT3/6k1atWqXZs2dLkjZt2qQjjjhCq1ev1pQpU7Tf\nfvtJks4991xdf/31w55j2bJluvnmmyV5PdgTJkzQG2+8kbWmRx55RBdeeKEkaerUqZo0adLWEH3s\nscdqwoQJkqQDDzxQL7zwAiEaAABgBPxcneMRSZmWbCh6Tei8CpwxLrVUT/RQO+6449avnXM67rjj\ndNttt6XdJ9Pj/LbDDjts/bqmpkabN28uew0AAACVgG2/fTZr1iw9+uijeu655yRJb7/9tp555hlN\nnTpVa9as0fPPPy9Jw0J2yrHHHqvrrrtOkjQwMKA333xT48eP14YNGzLe/6ijjtItt9wiSXrmmWf0\n4osvqrGxsdQvCwAAoKoRon02ceJE3XjjjTr77LN18MEHb23lGDt2rK6//nqdeOKJmjlzpnbfffeM\nj7/22mv14IMPavr06Tr00EO1atUq7brrrpo9e7amTZumtra2tPv/y7/8i7Zs2aLp06frrLPO0o03\n3pg2Aw0AAIDRM+dc0DXk1dzc7Do7O9PGnn76aR1wwAEBVYRM+J4AAICoM7PlzrnmfPdjJhoAAAAo\nkp+rcwAAAAA5tXfFtaijR719CdXXxdTW0qjWpoagy8qLEA0AAIBAtHfFNW9JtxL9A5KkeF9C85Z0\nS1LogzTtHAAAAAjEoo6erQE6JdE/oEUdPQFVVDhCNAAAAALR25coajxMCNEAAAAIRH1drKjxMCFE\nj9D69es1Y8YMzZgxQ3vuuacaGhq2/nnTpk2jOvadd96pRYsWlaTOc889V1OmTNEhhxyi/fffX+ed\nd556e3vzPm7x4sV69913S1IDAABAJm0tjYrV1qSNxWpr1NYS/o3iuLBwhHbdddetW3fPnz9f48aN\n0yWXXJJ2H+ecnHMaM6a49yqnnXZayeqUpGuuuUatra3asmWLFi9erGOOOUbd3d2qra3N+pjFixfr\nn/7pnzR27NiS1gIAAJCSungwiqtzVM1MdHtXXLMXLtOUufdo9sJlau+K+/I8zz33nA488ECdc845\nOuigg7R27VpdcMEFam5u1kEHHaRvf/vbW++79957a/78+WpqatLBBx+sZ555RpL04x//WBdddJEk\nbyb5a1/7mj74wQ/qfe97n+68805J3hbgX/ziFzV16lQdf/zxOuGEE9Te3p6ztjFjxuiSSy7RLrvs\novvvv1+SMtZ2zTXX6NVXX9VRRx2lj370o1nvBwAAMFqtTQ16dO4x+tvCE/Xo3GMiEaClKgnRqeVT\n4n0JOW1bPsWvIL169WpdfPHFWrVqlRoaGrRw4UJ1dnbqiSee0NKlS7Vq1aqt991jjz3U1dWlz3/+\n81q8eHHG47366qt69NFH1d7ernnz5kmSbr/9dsXjca1atUo33nij/vjHPxZc38yZM7V69WpJyljb\nxRdfrN13310PP/ywfvvb32a9HwAAQLWqihBd7uVT3v/+96u5edtukbfddptmzpypmTNn6umnn04L\noHPmzJEkHXrooVqzZk3G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zwFeTPEg3MzyVzcC2JHuBPw2U/xRYP/lg\n4dA1G4AvJTkATABfmM33JkmLUaqG7xJKksZF+ySNn7WPw5MkjQlnoiVJkqSenImWJEmSenImWpIk\nSerJJFqSJEnqySRakiRJ6skkWpIkSerJJFqSJEnqySRakiRJ6unf8KCUlWjHoSQAAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xc1277b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.array(X[:, 1].A1)\n",
    "f = model.predict(X).flatten()\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(12,8))\n",
    "ax.plot(x, f, 'r', label='Prediction')\n",
    "ax.scatter(data.Population, data.Profit, label='Traning Data')\n",
    "ax.legend(loc=2)\n",
    "ax.set_xlabel('Population')\n",
    "ax.set_ylabel('Profit')\n",
    "ax.set_title('Predicted Profit vs. Population Size')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4. normal equation（正规方程）\n",
    "正规方程是通过求解下面的方程来找出使得代价函数最小的参数的：$\\frac{\\partial }{\\partial {{\\theta }_{j}}}J\\left( {{\\theta }_{j}} \\right)=0$ 。\n",
    " 假设我们的训练集特征矩阵为 X（包含了${{x}_{0}}=1$）并且我们的训练集结果为向量 y，则利用正规方程解出向量 $\\theta ={{\\left( {{X}^{T}}X \\right)}^{-1}}{{X}^{T}}y$ 。\n",
    "上标T代表矩阵转置，上标-1 代表矩阵的逆。设矩阵$A={{X}^{T}}X$，则：${{\\left( {{X}^{T}}X \\right)}^{-1}}={{A}^{-1}}$\n",
    "\n",
    "梯度下降与正规方程的比较：\n",
    "\n",
    "梯度下降：需要选择学习率α，需要多次迭代，当特征数量n大时也能较好适用，适用于各种类型的模型\t\n",
    "\n",
    "正规方程：不需要选择学习率α，一次计算得出，需要计算${{\\left( {{X}^{T}}X \\right)}^{-1}}$，如果特征数量n较大则运算代价大，因为矩阵逆的计算时间复杂度为O(n3)，通常来说当n小于10000 时还是可以接受的，只适用于线性模型，不适合逻辑回归模型等其他模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 正规方程\n",
    "def normalEqn(X, y):\n",
    "    theta = np.linalg.inv(X.T@X)@X.T@y#X.T@X等价于X.T.dot(X)\n",
    "    return theta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-3.89578088],\n",
       "        [ 1.19303364]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_theta2=normalEqn(X, y)#感觉和批量梯度下降的theta的值有点差距\n",
    "final_theta2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#梯度下降得到的结果是matrix([[-3.24140214,  1.1272942 ]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在练习2中，我们将看看分类问题的逻辑回归。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    ""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3.0
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}